<!DOCTYPE html>
<html>

{include file='public/header'}
<style>
    .layui-input-block{
        margin-left: 100px;
    }
</style>
<body>
    <div class="x-nav">
        <span class="layui-breadcrumb">
            <a href="javascript:void(0)">首页</a>
            <a href="javascript:void(0)">充值面板管理</a>
            <a><cite>充值模板列表</cite></a>
        </span>
        <a class="layui-btn layui-btn-small" id="reload" title="刷新">
            <i class="layui-icon" style="line-height:30px"><i class="iconfont">&#xe6aa;</i></i>
        </a>
    </div>
    <div class="x-body">
        <form class="layui-form layui-row" style="margin-top:15px;margin-bottom: 10px;">
            <div class="layui-inline">
                <label class="layui-form-label w-auto">选择短剧：</label>
                <div id="video"></div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label w-auto">所属公司：</label>
                <div id="pMenu" style="width:100%;flex:1"></div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label w-auto">面板类型：</label>
                <div class="layui-input-inline" >
                    <select name="type" id="type">
                        <option value="">请选择</option>
                        <option value="1">低充</option>
                        <option value="2">中充</option>
                        <option value="3">高充</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline" style="margin-left:10px">
                <button class="layui-btn" lay-submit lay-filter="searchList">搜索</button>
                <button type="reset" id="resetList" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </form>
        <table id="template" lay-filter="template"></table>
    </div>

    <script>

        let params = {
            elem: '#template'
            , toolbar: '#toolbarDem'
            , url: '/admin/money/templateList' //数据接口
            , id: 'template'
            , limit:15
            , page:true
            // , totalRow: true
            , cols: [[ //表头
                { field: 'id', title: '模板ID', align: 'center', width:80 }
                , { field: 'name', title: '模板名称', align: 'center', width:200}

                , { field: 'responsibility_person_name', title: '投放负责人', align: 'center'}
                , { field: 'link_ids', title: '使用链接', align: 'center'}

                , { field: 'recharge_user_num', title: '充值人数', align: 'center', }
                , { field: 'recharge_number', title: '充值次数', align: 'center', }
                , { field: 'recharge_price', title: '充值金额', align: 'center', }
                , { field: 'per_capita_contribution', title: '充值用户贡献', align: 'center', }
                , { field: 'created_at', title: '模板创建时间',  width:200, align:'center', templet: function (d) {
                        return dayjsFormat(d.created_at)
                    }
                }
            ]]
        }
        tableList(params)
        let selectParams = {
            url:'/admin/company/select',
            selected:[],
            tips:'选择公司',
            name: 'company_id',
            field_id:'id',
            field_Name:'name',
            elem: '#pMenu'
        }
        selectN(selectParams)
        let selectParams2 = {
            url: '/admin/video/select',
            elem: '#video',
            selected: [],
            tips: '选择短剧',
            name: 'video_id',
            field_id: 'id',
            field_Name: 'name',
        }
        selectN(selectParams2)
    </script>
</body>

</html>